Skip to content

feat: NL tool discovery via local qwen#2

Merged
lance-sp merged 1 commit intomainfrom
feat/search-plugin
Mar 12, 2026
Merged

feat: NL tool discovery via local qwen#2
lance-sp merged 1 commit intomainfrom
feat/search-plugin

Conversation

@lance-sp
Copy link
Copy Markdown
Contributor

Summary

  • spai search plugin: natural language → spai command recommendation via local Ollama (qwen2.5-coder:7b)
  • setup.clj: ollama + model check added as optional dependency (same pattern as ripgrep)

Agent asks "find class predicates" → local 7B routes to spai refs. ~1200 prompt tokens for the full catalog, sub-second after prompt cache. Zero API cost for tool routing.

Inspired by the MCP token cost analysis — this is the CLI lazy-loading pattern taken to its conclusion: don't load schemas at all, let a local model be the index.

Test plan

  • spai search "who depends on this file" → should recommend spai who
  • spai search "what changed recently" → should recommend spai changes
  • spai search "biggest files" → should recommend spai hotspots
  • spai setup on machine without ollama → shows optional warning, doesn't block
  • spai setup with ollama but no qwen → offers to pull model

🤖 Generated with Claude Code

NL tool discovery via local qwen model. Agent asks a question
in English, local 7B model routes to the right spai command.
~1200 prompt tokens for the full 35-tool catalog, sub-second
after prompt cache warmup.

- plugins/spai-search: reads spai help, builds compact prompt,
  queries ollama, returns EDN recommendations
- setup.clj: ollama + qwen2.5-coder:7b check (optional dep,
  same pattern as ripgrep)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lance-sp lance-sp merged commit e719368 into main Mar 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant